<template>
  <tr>
    <td>合计:</td>
    <td colspan="5">
      {{ sum || 0 }}
    </td>
  </tr>
</template>

<script>
export default {
  props: ['obj'],
  computed: {
    sum() {
      // console.log(this.obj);
      return this.obj
        .filter((i) => i.checked)
        .reduce((p, i) => p + i.price * i.num, 0)
    },
  },
}
</script>

<style></style>
